<?php defined('_JEXEC') or die('Restricted access'); ?>
<form action="index.php" method="post" name="adminForm">
<div id="editcell">
    <table class="adminlist">
    <thead>
        <tr>
        	 <th width="5">
                <?php echo JText::_( '#' ); ?>
            </th>
        	<th width="20">
              <input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $this->items ); ?>);" />
            </th>
            <th>
                <?php echo JText::_( 'NAME' ); ?>
            </th>
            <th>
                <?php echo JText::_( 'organization' ); ?>
            </th>
            <th>
                <?php echo JText::_( 'ADDRESS' ); ?>
            </th>
             <th>
                <?php echo JText::_( 'OPENINGTIME' ); ?>
            </th>
             <th>
                <?php echo JText::_( 'CLOSINGTIME' ); ?>
            </th>
            <th>
                <?php echo JText::_( 'WEOPEN' ); ?>
            </th>
            <th width="5" >
                <?php echo JText::_( 'ID' ); ?>
            </th>
        </tr>            
    </thead>
    <?php
    $k = 0;
     for ($i=0, $n=count( $this->items ); $i < $n; $i++)
    {
        $row =& $this->items[$i];
        $checked    = JHTML::_( 'grid.id', $i, $row->id );
        $link = 'index.php?option=com_roombooking&controller=building&task=edit&cid[]='. $row->id ;
        ?>
        <tr class="<?php echo "row$k"; ?>">
            <td>
              <?php echo $i+1; ?>
            </td>
            <td>
              <?php echo $checked; ?>
            </td>
             <td>
                <a href="<?php echo $link; ?>"><?php echo $row->name; ?></a>
            </td>
            <td>
                <a href="<?php echo 'index.php?option=com_roombooking&controller=organization&task=edit&cid='.$row->o_id; ?>">
                <?php echo $row->o_name; ?>
                </a>
            </td>
            <td>
                <?php echo $row->address; ?>
            </td>
            <td>
                <?php echo $row->opening; ?>
            </td>
            <td>
                <?php echo $row->closing; ?>
            </td>
             <td>
                 <?php  if($row->we_opening==1) echo JText::_( 'Yes' ); else echo JText::_( 'No' ); ?>
            </td>
             <td>
              <?php echo $row->id; ?>
            </td>
        </tr>
        <?php
        $k = 1 - $k;
    }
    ?>
    </table>
</div>
 
<input type="hidden" name="option" value="com_roombooking" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="controller" value="building" />
 
</form>
